﻿using SHZY.Common.Security;
using SHZY.Common.Models;
using SHZY.BaseData.Entitys.Dto.QmsBaseMaterial;
using Mapster;

namespace SHZY.BaseData.Entitys.Mapper.QmsBaseMaterial;

public class Mapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<QmsBaseMaterialCrInput, QmsBaseMaterialEntity>()
            .Map(dest => dest.FileInfo, src => src.fileInfo.ToJsonString());
        config.ForType<QmsBaseMaterialEntity, QmsBaseMaterialInfoOutput>()
            .Map(dest => dest.fileInfo, src => src.FileInfo.ToObject<List<FileControlsModel>>());
    }
}
